package cn.edu.sdjzu.xg.eagle.service;

import cn.edu.sdjzu.xg.eagle.entity.User;
import cn.edu.sdjzu.xg.eagle.exception.BaseException;

import java.lang.reflect.InvocationTargetException;
import java.sql.Connection;
import java.sql.SQLException;

/**
 * @author tg.si@188.com
 * @todo
 * @since 2024/4/13 19:22
 */
public interface UserService {


    void login(User userToLogin) throws SQLException;
    User find(Integer id) throws SQLException, BaseException, InvocationTargetException;

    //这里修改user, 是不是就不用返回了，调用者使用引用
    int add(User user) throws SQLException;

    public boolean update(User user)throws SQLException ;
    public boolean update(Connection connection, User user)throws SQLException ;
    boolean delete(Long id)throws SQLException ;
    int add(Connection connection, User user)throws SQLException;
}
